<?php
/**
 * Description
 *
 * PHP version 7
 *
 * @category Custom
 * @package  Custom
 * @author   ryu <mo5467@126.com>
 * @date     2020-04-25 10:11:38
 * @lastTime 2020-05-01 23:00:29
 * @license  https://opensource.org/licenses/MIT MIT License
 * @link     none
 */

namespace Design\Structural\DataMapper;

class User
{

    private $username;

    private $email;


    public static function fromState(array $state): User
    {
        return new self($state['username'], $state['email']);

    }//end fromState()


    public function __construct(string $username, string $email)
    {
        $this->username = $username;
        $this->email    = $email;

    }//end __construct()


    public function getUsername()
    {
        return $this->username;

    }//end getUsername()


    public function getEmail()
    {
        return $this->email;

    }//end getEmail()


}//end class
